package com.huang.controller;

import com.huang.entity.User2;
import com.huang.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {

    @Resource
    UserService userService;
    @GetMapping("/{id}")
    public void findById(@PathVariable Integer id) {
        User2 user2 = userService.getById(id);
        log.info("user is {}", user2);
    }
}
